package com.crazymaker.springcloud.demo.api;

import com.crazymaker.springcloud.demo.fallback.UAAUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigInteger;

/**
 * path指定server.context-path
 * GetMapping 为全路径
 */
@FeignClient(
        value = "uaa-provider",
        path = "/uaa-provider",
        fallbackFactory = UAAUserFallbackFactory.class)
public interface UAAUserApi {
    @GetMapping("/api/user/detail/v1")
    public ResponseEntity<Object> getUser(@RequestParam(value = "userId", required = true) BigInteger userId);
}
